//系统相关配置管理
//多项目管理
import def_inout from "./def_inout";
import UserInfo from "./UserInfo";

import PersonnelInfo from "./PersonnelInfo";
import RoleTemplate from "./RoleTemplate";
import UserRole from "./UserRole";
import RuleTemplate from "./RuleTemplate";
export default class System_manager {
  constructor() {
    this.def_inout_list = [];

    this.user_list = [];

    this.personal_list = [];
    this.roletemplate_list = [];
    this.userrole_list = [];

    this.ruletemplate_list = [];
  }
  load() {
    let p4 = def_inout.load();
    let p9 = UserInfo.loadList();

    let p11 = PersonnelInfo.loadList();
    let p12 = RoleTemplate.loadList();

    let p13 = UserRole.loadList();
    let p14 = RuleTemplate.loadList();

    let that = this;
    return new Promise((resolve, reject) => {
      Promise.all([ p4, p9, p11, p12, p13, p14])
        .then(
          res => {
         
            that.def_inout_list = res[0];
            that.user_list = res[1];

        
            that.personal_list = res[2];
            that.roletemplate_list = res[3];
            that.userrole_list = res[4];
            that.ruletemplate_list = res[5];
            resolve(res);
          }
        )
    })
  }
}
